package com.briup.dao;

import com.briup.bean.Teacher;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;

@Repository
public class TeacherDAOImpl implements ITeacherDAO{
    @Override
    public Teacher findTeacherById(Integer id) throws Exception {
        //连接数据库 查询数据 返回 结果集 封装对象 jdbc
        // 语法异常
        if(id == 3){
            throw  new SQLException("数据库异常");
        }
        return new Teacher(1,"tom");
    }
}
